﻿using MySql.Data.MySqlClient;
using System.Collections.Generic;
using System.Threading.Tasks;

public abstract class DataStorer
{
    protected MySqlConnection _dbConnection;

    public DataStorer(string connectionString)
    {
        _dbConnection = new MySqlConnection(connectionString);
        _dbConnection.Open();
    }

    public abstract Task<int> StoreDevicesAsync(List<Device> devices);
    public abstract Task<int> StoreRealtimeDataAsync(List<RealtimeData> realtimeData);

    ~DataStorer()
    {
        _dbConnection?.Close();
        _dbConnection?.Dispose();
    }
}